{extend name="base" /}
{block name="js"}
<script src="__INDEX__/stocks/stocks.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<div class="l-loading" style="display: block" id="htr-loading"></div>
<div class="htr-toolbar">
	<div class='f-left tbr-m'>区域：</div>
	<select id="areaId1" class='j-ipt j-areas' level="0" onchange="HTR.ITAreas({id:'areaId1',val:this.value,className:'j-areas'});">
	  <option value="">-请选择-</option>
	  {volist name="areaList" id="vo"}
	  <option value="{$vo['areaId']}">{$vo['areaName']}</option>
	  {/volist}
	</select>
	<div class='f-left tbr-m'>产品名称：</div>
	<input type="text" name="goodsName"  placeholder='产品名称' id="goodsName" class='j-ipt'/>
	<div class='f-left tbr-m'>店铺名称：</div>
	<input type="text" name="shopName"  placeholder='店铺名称' id="shopName" class='j-ipt'/>
	<button class="btn btn-blue" onclick='javascript:loadGrid()'>查询</button>
  <button class="btn btn-red" onclick="javascript:toScan({$shopId})">扫码出库</button>
  {if HTRGrant('KCGL_01') && $authority}<button class="btn btn-green f-right" onclick='javascript:toEdit(0)'>新增</button>{/if}
	<div style='clear:both'></div>
</div>
<div id="maingrid"></div>
<div id='stockBox' style='display:none'>
  <form id='stockForm' autocomplete="off">
  <table class='htr-form htr-box-top'>
     <tr>
        <th width='100'>类型<font color='red'>*</font>：</th>
        <td height='24'>
           <label>
              <input type="radio" id="type1" name="type" class="ipt" value="1" checked>添加
           </label>
           <label>
              <input type="radio" id="type0" name="type" class="ipt" value="0">减少
           </label>
        </td>
     </tr>
     <tr>
        <th>数量<font color='red'>*</font>：</th>
        <td><input type='text' id='num' name="num" class='ipt' placeholder='数量' /></td>
     </tr>
     <tr>
        <th>描述<font color='red'>*</font>：</th>
        <td><textarea type='text' id='desc' name="desc" class='ipt' style="width:200px;height:50px;" placeholder='填写描述'></textarea></td>
     </tr>
  </table>
  </form>
</div>
<div id='shopBox' style='display:none'>
  <form id='shopForm' autocomplete="off">
  <table class='htr-form htr-box-top'>
     <tr>
        <th width='100'>店铺<font color='red'>*</font>：</th>
        <td height='24'>
          <select id="shopId" name='shopId' class='ipt'>
            <option value="">-请选择-</option>     
            {volist name="shopList" id="vo"}
            <option value="{$vo['shopId']}">{$vo['shopName']} - ({$vo['shopSn']})</option>
            {/volist}
          </select>
        </td>
     </tr>
  </table>
  </form>
</div>
<script>
$(function(){initGrid({$authority});})
</script>
{/block}